<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>店铺激励规则管理</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
		<link rel="stylesheet" href="../../layuiadmin/style/public.css" media="all">
	</head>
	<body>
		<div class="layui-fluid" id="LAY-component-grid-list">
			<div class="layui-card">
				<div class="layui-card-body">
					<!-- 搜索条件start -->
					<form class="layui-form meberMangement" action="">
						<div class="layui-row demo-list">
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">激励规则ID</label>
									<div class="layui-input-block">
										<input type="text" autocomplete="off" placeholder="精确搜索" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">店铺机构类型</label>
									<div class="layui-input-block">
										<select>
											<option value=""></option>
											<option value="">全部</option>
											<option value="0">1</option>
											<option value="1">2</option>
										</select>
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item" style="margin-bottom: 0;">
									<label class="layui-form-label" style="padding: 0;">配置自定义商品类型</label>
									<div class="layui-input-block">
										<select>
											<option value=""></option>
											<option value="">全部</option>
											<option value="0">1</option>
											<option value="1">2</option>
										</select>
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">当前审核状态</label>
									<div class="layui-input-block">
										<select>
											<option value=""></option>
											<option value="">全部</option>
											<option value="0">1</option>
											<option value="1">2</option>
										</select>
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">广告类型</label>
									<div class="layui-input-block">
										<select>
											<option value=""></option>
											<option value="">全部</option>
											<option value="0">1</option>
											<option value="1">2</option>
										</select>
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">规则名称</label>
									<div class="layui-input-block">
										<input type="text" autocomplete="off" placeholder="模糊搜索" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">激励类型</label>
									<div class="layui-input-block">
										<select>
											<option value=""></option>
											<option value="">全部</option>
											<option value="0">1</option>
											<option value="1">2</option>
										</select>
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">自定义分类名称</label>
									<div class="layui-input-block">
										<input type="text" autocomplete="off" placeholder="模糊搜索" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">审核人</label>
									<div class="layui-input-block">
										<input type="text" autocomplete="off" placeholder="模糊搜索" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-col-sm3 layui-col-md3 layui-col-lg2dot4">
								<div class="layui-form-item">
									<label class="layui-form-label">创建人</label>
									<div class="layui-input-block">
										<input type="text" autocomplete="off" placeholder="模糊搜索" class="layui-input">
									</div>
								</div>
							</div>
							<div class="layui-col-sm6 layui-col-md6 layui-col-lg12" style="justify-content: flex-end;display: flex;">
								<div class="layui-btn-container">
									<button type="button" class="layui-btn">清空搜索</button>
									<button type="button" class="layui-btn">导出</button>
									<button type="button" class="layui-btn" style="margin-right: 0;">搜索</button>
								</div>
							</div>
						</div>
					</form>
					<!-- 搜索条件end -->
					<!-- tab标签start -->
					<div class="layui-tab custom-tab">
						<div style="justify-content:space-between;display: flex;margin-bottom: -10px;">
							<ul class="layui-tab-title" style="border-bottom: none;">
								<li>
									<a href="allShopRuleManagement.html">全部</a>
								</li>
								<li>
									<a href="auditingShopRuleManagement.html">待审核</a>
								</li>
								<li>
									<a href="passShopRuleManagement.html">审核通过</a>
								</li>
								<li class="layui-this">
									<a href="failedShopRuleManagement.html">审核不通过</a>
								</li>
							</ul>

							<div class="layui-btn-container">
								<button type="button" class="layui-btn" style="margin:0;" id="addRule-btn">新增激励规则</button>
							</div>

						</div>
						<div class="layui-tab-content" style="padding: 0;">
							<div class="layui-tab-item layui-show">
								<!-- 店铺激励规则管理start -->
								<div class="layui-table-meber">
									<table id="allMember" lay-filter="allMember" class="layui-table" lay-skin="nob"></table>
								</div>
								<!-- 店铺激励规则管理end -->

								<!-- 激励规则信息start -->
								<script type="text/html" id="webchatMsg">
									<div>
										<div class="meberId">激励规则ID：IR1000010008</div>
										<div class="list-data">
											<p>规则名称：</p>
											<p>规则描述：</p>
										</div>
									  </div>
								</script>
								<!-- 激励规则信息end -->
								<!-- 店铺信息start -->
								<script type="text/html" id="memberMsg">
									<div>
										<div class="meberId"></div>
										<div class="list-data">
											<p>应用店铺类型列表：</p>
											<p>自定义分类列表：</p>
										</div>
									  </div>
								</script>
								<!-- 店铺信息end -->
								<!-- 规则信息start -->
								<script type="text/html" id="registerMsg">
									<div class="table-barDemo">
									<div class="meberId"></div>
									<div class="list-data">
										<p>广告类型：</p>
										<p>配置自定义商品类型：自营配置</p>										
										<p>普通发票税点：</p>
										<p>增值税发票税点：</p>									
										<p>规则开始时间：</p>									
										<p>规则结束时间：</p>
									</div>
								  </div>
								</script>
								<!-- 规则信息end -->
								<!-- 状态信息start -->
								<script type="text/html" id="roleMsg">
									<div class="table-barDemo">
									<div class="meberId"></div>
									<div class="list-data">
										<p>当前审核状态：审核不通过</p>
										<p>资料更新重审状态：无</p>
										<p>创建人：</p>
										<p>创建时间：</p>
										<p>最后审核人：</p>
										<p>最后审核时间：</p>
									</div>
								  </div>
								</script>
								<!-- 状态信息end -->
								<!-- 操作start -->
								<script type="text/html" id="memberMsgOperate">
									<div class="table-barDemo">
									<div class="meberId"></div>
									  <a class="layui-btn layui-btn-sm" lay-event="edit">商品激励修改</a>
									  <a class="layui-btn layui-btn-sm" lay-event="editRule">编辑</a>
								  </div>
								</script>
								<!-- 操作end -->
							</div>
						</div>
					</div>
					<!-- tab标签end -->
				</div>
			</div>
		</div>
		<!-- 商品激励修改start -->
		<div class="edit-box" id="edit-box">
			<div class="layui-card">
				<div class="layui-card-body">
					<form class="layui-form" action="">
						<div class="layui-row demo-list">
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-form-item">
									<label class="layui-form-label">激励类型</label>
									<div class="layui-input-block">
										<div style="overflow: hidden;margin-bottom: 10px;">
											<div class="layui-input-inline" style="width: auto;margin-top: 5px;">
												<input type="radio" name="incentive" value="0" title="所有商品统一激励规比例:">
											</div>
											<div class="layui-input-inline" style="width: auto;">
												<input type="text" class="layui-input">
											</div>
											<div class="layui-form-mid layui-word-aux">%</div>
										</div>
										<div style="overflow: hidden;margin-bottom: 10px;">
											<div class="layui-input-inline" style="width: auto;margin-top: 5px;">
												<input type="radio" name="incentive" value="1" title="所有商品统一激励规一口价:">

											</div>
											<div class="layui-input-inline" style="width: auto;">
												<input type="text" class="layui-input">
											</div>
											<div class="layui-form-mid layui-word-aux">元</div>
										</div>
										<div style="overflow: hidden;margin-bottom: 10px;">
											<div class="layui-input-block" style="width: auto;margin-top: 5px;margin-left:0;">
												<input type="radio" name="incentive" value="2" title="定义激励比例 注：不同商品，可以设置不同激励比例，不同激励一口价，不同推广价">
											</div>

											<div class="layui-input-block" style="margin-left: 0;">
												<div style="justify-content: space-between;display: flex;">
													<div style="flex:1;">
														<textarea placeholder="批量输入货品ID" class="layui-textarea"></textarea>
													</div>
													<div style="width:120px;display: flex;align-items:flex-end;">
														<button type="button" class="layui-btn" style="width:120px;margin-left: 10px;">批量查询</button>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-btn-container">
									<button type="button" class="layui-btn btn_scale">批量设置激励比例</button>
									<button type="button" class="layui-btn btn_price">批量设置激励一口价</button>
									<button type="button" class="layui-btn btn_delect">批量删除</button>
								</div>
							</div>
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<table id="goodsTable" lay-filter="goodsTable" class="layui-table"></table>
							</div>
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-btn-container" style="text-align: center;margin-top: 10px;">
									<button class="layui-btn">保存</button>
									<div class="layui-btn layui-btn-primary cancel-btn">取消</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!-- 商品激励修改end -->

		<!-- 批量设置激励比例start -->
		<div class="scale-box" id="scale-box">
			<div class="layui-card">
				<div class="layui-card-body">
					<form class="layui-form" action="">
						<div class="layui-row demo-list">
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-form-item">
									<label class="layui-form-label" style="padding: 0px 15px;">批量设置激励比例</label>
									<div class="layui-input-inline">
										<input type="text" class="layui-input">
									</div>
									<div class="layui-form-mid layui-word-aux">%</div>
								</div>
							</div>
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-btn-container" style="text-align: center;margin-top: 10px;">
									<button class="layui-btn">确定</button>
									<div class="layui-btn layui-btn-primary closeIndex-btn">取消</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!-- 批量设置激励比例end -->

		<!-- 批量设置激励一口价start -->
		<div class="price-box" id="price-box">
			<div class="layui-card">
				<div class="layui-card-body">
					<form class="layui-form" action="">
						<div class="layui-row demo-list">
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-form-item">
									<label class="layui-form-label" style="padding: 0px 15px;">批量设置激励一口价</label>
									<div class="layui-input-inline">
										<input type="text" class="layui-input">
									</div>
									<div class="layui-form-mid layui-word-aux">元</div>
								</div>
							</div>
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-btn-container" style="text-align: center;margin-top: 10px;">
									<button class="layui-btn">确定</button>
									<div class="layui-btn layui-btn-primary closeIndex-btn">取消</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!-- 批量设置激励一口价end -->

		<!-- 编辑激励规则start -->
		<div class="editRule-box" id="editRule-box">
			<div class="layui-card">
				<div class="layui-card-body">
					<form class="layui-form" action="">
						<div class="layui-row demo-list">
							<div class="layui-form-item" style="font-weight:bold;">
								<label class="layui-form-label" style="font-weight:bold;">激励规则ID</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" value="IR1000010008ID" readonly="true" style="border: none;">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">规则名称</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" placeholder="请输入规则名称">
								</div>
							</div>
							<div class="site-title">
								<fieldset>
									<legend><a name="blockquote">激励规则</a></legend>
								</fieldset>
							</div>

							<div class="layui-form-item">
								<label class="layui-form-label">激励规则有效期</label>
								<div class="layui-input-block">
									<div style="overflow: hidden;margin-bottom: 10px;">
										<div class="layui-input-inline" style="width: auto;margin-top: 5px;">
											<input type="radio" name="time" value="0" title="不设置有效期">
										</div>
									</div>
									<div style="overflow: hidden;margin-bottom: 10px;">
										<div class="layui-input-inline" style="width: auto;">
											<input type="radio" name="time" value="1">
										</div>
										<div class="layui-input-inline" style="width: auto;">
											<input type="text" class="layui-input" id="startTime" placeholder="开始时间">
										</div>
										<div class="layui-form-mid layui-word-aux">--</div>
										<div class="layui-input-inline" style="width: auto;">
											<input type="text" class="layui-input" id="endTime" placeholder="结束时间">
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-form-label">选择合伙店铺</div>
								<div class="layui-input-block">
									<div class="layui-input-inline" style="width: auto;margin-right: 10px;">
										<select>
											<option value="">请选择</option>
											<option value="1">1</option>
											<option value="2">2</option>
										</select>
									</div>
									<div class="layui-form-mid layui-word-aux">--</div>
									<div class="layui-input-inline" style="width: auto;" id="shop-box">
										<input type="text" class="layui-input" placeholder="请选择" readonly id="shop">
										<div style="display: none;" id="shop-container">
											<div class="layui-btn-container">
												<a class="layui-btn layui-btn-sm">全选</a>
												<a class="layui-btn layui-btn-sm">清空</a>
												<a class="layui-btn layui-btn-sm">反选</a>
											</div>

											<div>
												<div><input type="checkbox" name="shop" lay-skin="primary" title="莲藕互联网医院"></div>
												<div><input type="checkbox" name="shop" lay-skin="primary" title="阿康连锁"></div>
												<div><input type="checkbox" name="shop" lay-skin="primary" title="广州天河石牌村村医"></div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">已选店铺</label>
								<div class="layui-input-block">
									<div style="padding: 6px 10px;min-height: 100px; border:1px solid #e6e6e6;background-color: #fff;
    border-radius: 2px;">
										<span style="margin-right: 10px;">
											莲藕互联网医院 <i class="layui-icon layui-icon-close"></i>
										</span>

										<span style="margin-right: 10px;">
											莲藕互联网医院 <i class="layui-icon layui-icon-close"></i>
										</span>
									</div>
									<!-- <textarea class="layui-textarea"></textarea> -->
								</div>
							</div>
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">规则描述</label>
								<div class="layui-input-block">
									<textarea class="layui-textarea" placeholder="请输入规则描述"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<div style="display: flex;justify-content: space-between;">
									<div class="custom-selectType">
										<div class="custom-title">
											选择分类：
										</div>
										<div class="custom-content">
											<!-- 树状图start -->
											<div id="test-tree" class="demo-tree-more"></div>
											<!-- 树状图end -->
										</div>
									</div>
									<div style="margin-left: 10px;margin-right: 10px;display: flex;align-items:center;">
										<a class="layui-btn layui-btn-sm">确认选择</a>
									</div>
									<div class="custom-selectType">
										<div class="custom-title" style="display: flex;justify-content: space-between;">
											<div>已选分类名称：</div>
											<div>
												<span>
													置顶
												</span>
												<span>
													排序
												</span>
											</div>
										</div>
										<div class="custom-content custom-content-list">
											<ul>
												<li>
													<div>男科</div>
													<div>
														<span style="margin-right: 36px;">
															<i class="layui-icon layui-icon-upload-circle"></i>
														</span>
														<span style="margin-right: 20px;">
															<i class="layui-icon layui-icon-align-center"></i>
														</span>
													</div>
												</li>
												<li>
													<div>男科</div>
													<div>
														<span style="margin-right: 36px;">
															<i class="layui-icon layui-icon-upload-circle"></i>
														</span>
														<span style="margin-right: 20px;">
															<i class="layui-icon layui-icon-align-center"></i>
														</span>
													</div>
												</li>
											</ul>
										</div>
									</div>
								</div>
							</div>
							<div class="layui-form-item radio-item">
								<label class="layui-form-label" style="padding: 0 15px;">配置自定义分类商品</label>
								<div class="layui-input-block">
									<input type="radio" name="setGoods" value="0" title="自营配置">
									<input type="radio" name="setGoods" value="1" title="非自营配置">
								</div>
							</div>

							<div class="layui-form-item">
								<div style="display: flex;justify-content: space-between;">
									<div class="custom-selectType custom-selectType2">
										<div class="custom-title">
											<div>选择自定义分类</div>
											<div>分类批量设置商品</div>
										</div>
										<div class="custom-content">
											<div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
											</div>
											<div> 
											<textarea placeholder="请输入内容" class="layui-textarea" style="padding: 0;height: 240px;border: none;"></textarea></div>
										</div>
									</div>
									<div style="margin-left: 10px;margin-right: 10px;display: flex;align-items:center;">
										<a class="layui-btn layui-btn-sm">确认选择</a>
									</div>
									<div class="custom-selectType custom-selectType2">
										<div class="custom-title" style="display: flex;justify-content: space-between;">
											<div>分类</div>
											<div>
												已配置商品
											</div>
										</div>
										<div class="custom-content">
											<div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
												<div><input type="radio" name="sex" value="女" title="女"></div>
												<div><input type="radio" name="sex" value="男" title="男"></div>
											</div>
											<div>
												2
											</div>
										</div>
									</div>
								</div>
							</div>

							<div class="layui-form-item radio-item">
								<label class="layui-form-label" style="padding: 0 15px;">广告类型</label>
								<div class="layui-input-block">
									<input type="radio" name="advertisement" value="0" title="非自营广告">
									<input type="radio" name="advertisement" value="1" title="自营广告">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">发票税点</label>
								<div class="layui-input-block">
									<div style="overflow: hidden;margin-bottom: 10px;">
										<div class="layui-form-mid layui-word-aux">增值税发票税点</div>
										<div class="layui-input-inline" style="width: auto;">
											<input type="text" class="layui-input">
										</div>
										<div class="layui-form-mid layui-word-aux">%</div>
									</div>
									<div style="overflow: hidden;margin-bottom: 10px;">
										<div class="layui-form-mid layui-word-aux">普通发票税点</div>
										<div class="layui-input-inline" style="width: auto;">
											<input type="text" class="layui-input">
										</div>
									</div>
								</div>
							</div>
							<div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
								<div class="layui-btn-container" style="text-align: center;margin-top: 10px;">
									<button class="layui-btn">确定</button>
									<div class="layui-btn layui-btn-primary closeIndex-btn">取消</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!-- 编辑激励规则end -->
		<script src="../../layuiadmin/layui/layui.js"></script>
		<script>
			layui.config({
				base: '../../layuiadmin/' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index', 'form', 'element', 'table', 'laydate', 'layarea', 'tree'], function() {
				var $ = layui.$,
					admin = layui.admin,
					element = layui.element,
					form = layui.form,
					table = layui.table,
					laydate = layui.laydate,
					layarea = layui.layarea,
					tree = layui.tree;
				console.log(layui.tree)

				//基本演示
				tree.render({
					elem: '#test-tree' //绑定元素
						,
					showCheckbox: true //是否显示复选框
						,
					data: [{
						title: '江西' //一级菜单
							,
						children: [{
							title: '南昌' //二级菜单
								,
							children: [{
								title: '高新区' //三级菜单
								//…… //以此类推，可无限层级
							}]
						}]
					}, {
						title: '陕西' //一级菜单
							,
						children: [{
							title: '西安' //二级菜单
						}]
					}]
				});



				$("#shop").on('click', function() {
					$("#shop-container").toggle();
				});

				//所有会员表格实例
				table.render({
					elem: '#allMember',
					url: layui.setter.base + 'json/table/user.js' //数据接口
						,
					page: true //开启分页
						,
					limit: 5,
					cols: [
						[ //表头
							{
								type: 'checkbox',
							}, {
								field: 'username',
								title: '激励规则信息',
								templet: '#webchatMsg'
							}, {
								field: 'sex',
								title: '店铺信息',
								templet: '#memberMsg'
							}, {
								field: 'city',
								title: '规则信息',
								templet: '#registerMsg'
							}, {
								field: 'sign',
								title: '状态信息',
								templet: '#roleMsg'
							}, {
								title: '操作',
								width: 120,
								align: 'center',
								toolbar: '#memberMsgOperate'
							}
						]
					]
				});

				// 商品表格
				table.render({
					elem: '#goodsTable',
					url: layui.setter.base + 'json/table/user.js' //数据接口
						,
					page: true //开启分页
						,
					cols: [
						[ //表头
							{
								type: 'checkbox',
								width: 80,
								fixed: 'left'
							},
							{
								type: 'numbers',
								title: '序号',
								width: 80,
								fixed: 'left'
							}, {
								field: 'id',
								title: '货品ID',
								width: 120
							}, {
								field: 'username',
								title: '商品名',
								width: 160
							}, {
								field: 'sex',
								title: '通用名',
								width: 160
							}, {
								field: 'city',
								title: '规格',
								width: 160
							}, {
								field: 'sign',
								title: '商品理论库存',
								width: 160
							}, {
								field: 'experience',
								title: '2B批发价A',
								width: 160
							}, {
								field: 'logins',
								title: '2C官方零售价B',
								width: 160
							}, {
								field: 'wealth',
								title: '推广价（默认A\B 比价取最大值）',
								width: 300,
								edit: 'text'
							}, {
								field: 'classify',
								title: '激励比例',
								width: 160,
								edit: 'text'
							}, {
								field: 'score',
								title: '激励一口价',
								width: 160,
								edit: 'text'
							}, {
								field: 'sign',
								title: '1件商品佣金预算',
								width: 200
							}
						]
					]
				});

				//监听工具条
				table.on('tool(allMember)', function(obj) {
					var data = obj.data;
					console.log(data);
					switch (obj.event) {
						case 'edit':
							// 商品激励修改
							layer.open({
								type: 1,
								title: '商品激励修改',
								area: '1000px',
								shade: 0.8,
								id: 'LAY_edit' //设定一个id，防止重复弹出
									,
								btnAlign: 'c',
								moveType: 1 //拖拽模式，0或者1
									,
								content: $("#edit-box"),
								success: function(layero) {

								}
							});
							break;
						case 'editRule':
							// 编辑激励规则
							layer.open({
								type: 1,
								title: '编辑激励规则',
								area: '1000px',
								shade: 0.8,
								id: 'LAY_editRule' //设定一个id，防止重复弹出
									,
								btnAlign: 'c',
								moveType: 1 //拖拽模式，0或者1
									,
								content: $("#editRule-box"),
								success: function(layero) {

								}
							});
							break;
					}
					// if(obj.event === 'detail'){
					//   layer.msg('ID：'+ data.id + ' 的查看操作');
					// } else if(obj.event === 'del'){
					//   layer.confirm('真的删除行么', function(index){
					//     obj.del();
					//     layer.close(index);
					//   });
					// } else if(obj.event === 'edit'){
					//   layer.alert('编辑行：<br>'+ JSON.stringify(data))
					// }
				});
				
				// 新增激励规则
				$("#addRule-btn").on('click', function() {
					layer.open({
						type: 1,
						title: '新增激励规则',
						area: '1000px',
						shade: 0.8,
						id: 'LAY_editRule' //设定一个id，防止重复弹出
							,
						btnAlign: 'c',
						moveType: 1 //拖拽模式，0或者1
							,
						content: $("#editRule-box"),
						success: function(layero) {
					
						}
					});
				});

				// 时间插件
				laydate.render({
					elem: '#startTime'
				});

				laydate.render({
					elem: '#endTime'
				});

				// 取消按钮关闭所有弹出层
				$(".cancel-btn").on('click', function() {
					layer.closeAll();
				});

				// 取消按钮关闭弹窗
				$(".closeIndex-btn").on('click', function() {
					layer.close(layer.index);
				});


				// 批量设置激励比例
				$(".btn_scale").on('click', function() {
					layer.open({
						type: 1,
						title: '批量设置激励比例',
						area: '400px',
						shade: 0.8,
						id: 'LAY_scale' //设定一个id，防止重复弹出
							,
						btnAlign: 'c',
						moveType: 1 //拖拽模式，0或者1
							,
						content: $("#scale-box"),
						success: function(layero) {

						}
					});
				});

				// 批量设置激励一口价
				$(".btn_price").on('click', function() {
					layer.open({
						type: 1,
						title: '批量设置激励比例',
						area: '400px',
						shade: 0.8,
						id: 'LAY_price' //设定一个id，防止重复弹出
							,
						btnAlign: 'c',
						moveType: 1 //拖拽模式，0或者1
							,
						content: $("#price-box"),
						success: function(layero) {

						}
					});
				});

				// 批量删除
				$(".btn_delect").on('click', function() {
					layer.confirm('是否批量删除商品？', {
						title: '温馨提示',
						icon: 3,
						btn: ['确定', '取消'] //按钮
					}, function(index) {
						// 确定
						layer.close(index);
					}, function() {
						// 取消
					});
				});
			});
		</script>
	</body>
</html>
